﻿@model PerfectBuyData.Usuario

@{
    ViewBag.Title = "Registro";
}

@*<script type="text/javascript" src="../../Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript">


    function registrar() {

        
        var userName = $("#userName").val();
        var userPassword = $("#userPassword").val();
        var email = $("#email").val();

        var usuario = {
            userName: userName,
            userPassword: userPassword,
            email: email};

        $.ajax({
            type: "POST",
            data: usuario,
            url: "/Login/Valida",
            success: function (data) {
                if (data.length > 0) {
                    alert(data);
                } else {
                    location.reload();
                }
            }
        });
    }


</script>*@


@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <article id="address">
        <h1>Registrarse</h1>
        <h3>Registrate a Perfect Buy!</h3>
        <form>
            <p></p>

            <div class="editor-label">
                <label>Usuario</label>
            </div>
            <div class="editor-field">
                <input id="userName" name="userName" type="text" autofocus="autofocus"  maxlength="15"  required="required"/>
            </div>
            <div class="editor-label">
                <label>Contraseña</label>
            </div>
            <div class="editor-field">
                <input id="userPassword" name="userPassword" type="password" required="required" />
            </div>
             <div class="editor-label">
                <label>Email</label>
            </div>
            <div class="editor-field">
                 <input id="email" name="email" type="email" required="required"/>
            </div>
            <p>
                <input type="submit" value="Registrarse" />
            </p>
           
            @ViewBag.mensaje
                
                
        </form>
    </article>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
